my_dict = {"汪总": 99, "周杰伦": 88, "凌总": 77}

my_dict2 = {}
my_dict3 = dict()


print(f"字典1的内容是：{my_dict}, 类型是：{type(my_dict)}")
print(f"字典2的内容是：{my_dict2}, 类型是：{type(my_dict2)}")
print(f"字典3的内容是：{my_dict3}, 类型是：{type(my_dict3)}")

# 注意：字典中key不可重复
my_dict = {"汪总": 99, "汪总": 88, "凌总": 77}
print(f"重复key的字典内容是:{my_dict}")


# 通过key获取value
my_dict = {"汪总": 99, "周杰伦": 88, "凌总": 77}
score = my_dict["汪总"]
print(f"汪总考了{score}分")


# 定义嵌套字典

stu_score_dict = {
    "王力宏": {
        "语文": 77,
        "数学": 66,
        "英语": 33
    }, "周姐": {
        "语文": 11,
        "数学": 45,
        "英语": 89
    }, "王总": {
        "语文": 43,
        "数学": 22,
        "英语": 90
    }
}
print(f"大家的成绩单:{stu_score_dict}")

# 如何从嵌套字典中获取信息
score = stu_score_dict["王总"]["语文"]
print(f"王总的语文成绩是:{score}")

